package com.study.ssm.web.service.impl;

import com.study.ssm.web.dao.UserMapper;
import com.study.ssm.web.entity.User;
import com.study.ssm.web.service.UserService;
import lombok.Getter;
import lombok.Setter;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zhoujunlin
 * @date 2023年07月25日 10:26
 * @desc
 */
public class UserServiceImpl implements UserService {

    @Getter
    @Setter
    private UserMapper userMapper;

    /**
     * @param user
     * @return
     */
    @Override
    @Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, readOnly = false,
            timeout = -1, rollbackFor = Exception.class)
    public int save(User user) {
        return userMapper.saveUser(user);
    }

}
